package com.edu.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.edu.bean.Cars;
import com.edu.bean.Carsdata;
import com.edu.bean.CommonResult;
import com.edu.bean.Orders;
import com.edu.bean.Ordersdata;
import com.edu.service.CarService;
import com.edu.service.OrdersService;
import com.edu.service.impl.CarsServiceImpl;
import com.edu.service.impl.OrdersServiceImpl;
@WebServlet("/mainone.do")
public class MianoneServlet extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		OrdersService os = new OrdersServiceImpl();
		Ordersdata<Orders> orderdata = os.selecttotal();
		System.out.println(orderdata);
		CommonResult result = new CommonResult();
		result.setCode(200);
		result.setMessage("success");
		result.setData(orderdata);
		resp.setContentType("application/json;charset=utf-8");
		resp.getWriter().write(result.toJsonString());
	}
}
